package mornd.test2;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: mornd
 * @dateTime: 2023/5/7 - 17:47
 */

public class Controller1 {

    public void test(@RequestParam(name = "name1") String name1,
                     String name2,
                     @RequestParam("age") int age,
                     @RequestParam(name = "home1", defaultValue = "${JAVA_HOME}") String home1,
                     @RequestParam("file") MultipartFile file,

                     @PathVariable("id") int id,
                     @RequestHeader("content-type") String header,
                     @CookieValue("token") String token,
                     @Value("${JAVA_HOME}") String javaHome,
                     HttpServletRequest request,
                     @ModelAttribute User user,
                     User user2,
                     @RequestBody User user3) {

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    static class User {
        private Integer id;
        private String name;
    }
}
